<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<table border="1" cellpadding="5">
			<thead>
				<tr>
					<th>ID</th>
					<th>Name</th>
					<th>Pid</th>
					<th>Path</th>
					<th>子类</th>
					<th>操作</th>
					<th>操作</th>
				</tr>
			</thead>

			<tbody>
				<?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$row): $mod = ($i % 2 );++$i;?><tr>
						<td><?php echo ($row["id"]); ?></td>
						<?php
 $arr = explode(",", $row["path"]); array_pop($arr); $size = count($arr); ?>
						<td><?php echo str_repeat("|-", $size - 1); echo ($row["name"]); ?></td>
						<td><?php echo ($row["pid"]); ?></td>
						<td><?php echo ($row["path"]); ?></td>
						<?php if($size == 3): ?><td>X</td>
							<?php else: ?>
							<td>
								<a href="<?php echo U('add',array('pid'=>$row['id'],'path'=>$row['path'].$row['id'].','));?>">添加</a>
							</td><?php endif; ?>
						<td>
							<a href="<?php echo U('edit',array('id'=>$row['id']));?>">修改</a>
						</td>
						<td>
							<a href="<?php echo U('delete',array('id'=>$row['id']));?>">删除</a>
						</td>
					</tr><?php endforeach; endif; else: echo "" ;endif; ?>
			</tbody>

		</table>
	</body>

</html>